using System;
using System.Runtime.InteropServices;
using System.Text;

namespace Optimus
{
    // manual redefinition to make string handling friendlier to implementors

    [ComVisible(true)]
    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    [Guid("028EEE63-55A5-4280-8177-960AEB407B77")]
    public interface IOptimusPlugin
    {
        [return: MarshalAs(UnmanagedType.Bool)]
        bool Paint(IntPtr HDC);
        void OnKeyDown();
        int GetInfo(Info index);

        [return:MarshalAs(UnmanagedType.Bool)]
        bool GetProperty(int index,
            /*[Out, MarshalAs(UnmanagedType.LPArray, SizeConst=256)] byte[] name, 
            [Out, MarshalAs(UnmanagedType.LPArray, SizeConst=256)] byte[] value);*/
            [Out, MarshalAs(UnmanagedType.BStr)] out string name,
            [Out, MarshalAs(UnmanagedType.BStr)] out string value);

        [return: MarshalAs(UnmanagedType.Bool)]
        bool SetProperty([MarshalAs(UnmanagedType.LPStr)]string name, [MarshalAs(UnmanagedType.LPStr)]string value);
        [return: MarshalAs(UnmanagedType.Bool)]
        bool ShowProperties(IntPtr hwnd);
        [return: MarshalAs(UnmanagedType.Bool)]
        bool OnEvent(OptimusEvent evt);
    }
}